home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / misc / SP_ProjectMan.lha / SP-ProjectMan / Rexx / edit.sman next >
Text File  |  1997-12-31  |  1KB  |  53 lines

  1. /*
  2.  - Edit.sman
  3.  -
  4.  - ARexx program to edit the content of a file.
  5.  - The editor tool depends of the file extension.
  6.  - The tool is launched asynchronously.
  7.  -
  8.  - © Copyright 1995-1996 Bernard Krummenacher Silicon-Peace
  9.  -
  10.  - Bernard Krummenacher    Silicon-Peace 95.04.11    Created this file.
  11.  - Bernard Krummenacher    Silicon-Peace 96.08.14    Tried to make it usable with almost any Amiga..
  12. */
  13.  
  14. parse arg FileName '.' Extension
  15.  
  16. options results
  17.  
  18. if (UPPER(Extension) = 'MUIB') then
  19.   address COMMAND 'mui:muibuilder/muibuilder ' '"'FileName'.'Extension'"'
  20. else
  21.   if (((lastpos('SCOPTIONS',upper(FileName)) + 8) = length(FileName)) & (Extension = '')) then
  22.     do
  23.       path = left(FileName,lastpos('/',FileName))
  24.       oldPath = pragma('Directory',path)
  25.       address COMMAND 'scopts'
  26.       pragma('Directory',oldPath)
  27.     end;
  28.   else
  29. /*
  30.     if (UPPER(Extension) = 'GUIDE') then
  31.       address COMMAND 'Appls:Outils/AmigaGuide/Heddley/Heddley ' FileName'.'Extension
  32.     else
  33. */
  34.     do
  35.       EnvVar = 'env:editor'
  36.       if (EXISTS(EnvVar)) then
  37.         do
  38.           if OPEN(EditorVar,'env:editor','R') then
  39.             do
  40.               Editor = READLN(EditorVar)
  41.               if CLOSE(EditorVar) then
  42.                 nop
  43.             end;
  44.         end;
  45.       else
  46.         Editor = 'ed'
  47.       if (Extension = '') then
  48.     address COMMAND Editor '"'FileName'"'
  49.       else
  50.     address COMMAND Editor '"'FileName'.'Extension'"'
  51.     end;
  52. return 0
  53.